<include file='Index/nav'/>
<div class="container-fluid">
    <div class="row">
        <div class="col-sm-12 col-md-12">
            <form id='msgform' action='<{:U("Addtimemsg/addExpire")}>' method="post" style="display: none"></form>
            <div class="panel panel-default">
                <!-- Default panel contents -->
                <div class="panel-heading">
                    <h4>到期提醒短信</h4>
                </div>
                <div class="panel-body">
                    <h4 class="text-muted">请输入短信内容　<small>(已输入 <kbd id='hip'>0</kbd> 字，还可输入 <kbd id='words'>500</kbd> 字，最多500字，统计 <kbd id='ts'>0</kbd> 条)</small></h4>
                    <p style="margin-bottom: 20px;"><textarea name='msgcontent' form='msgform' class='form-control msgcontent' rows='5' placeholder="短信内容（最多500字）" autofocus required style="resize: none;"></textarea></p>
                    <h4 class="text-muted">请选择签名</h4>
                    <p style="margin-bottom: 20px;">
                        <select class="input-sm" name="sign" form="msgform">
                            <option value="<{:C('DEFAULT_SIGNATURE')}>"><{$Think.config.DEFAULT_SIGNATURE}></option>
                            <foreach name="signat" item="vo">
                                <option value="<{$vo.signature}>"><{$vo.signature}></option>
                            </foreach>
                        </select>
                    </p>
                    <h4 class='text-muted'>请选择距离到期天数</h4>
                    <p style="margin-bottom: 20px;">
                        <select name='nod' form='msgform' class='input-sm'>
                            <for start='1' end='31'>
                                <option value='<{$i}>'><{$i}></option>
                            </for>
                        </select>　天
                    </p>
                    <h4 class='text-muted'>请选择发送时间</h4>
                    <p style="margin-bottom: 20px;">
                        <select name='sendhour' form='msgform' class='input-sm'>
                            <for start='8' end='21'>
                                <option value='<lt name="i" value="10">0</lt><{$i}>'><lt name="i" value="10">0</lt><{$i}></option>
                            </for>
                        </select>　时　
                        <select name='sendminute' form='msgform' class='input-sm'>
                            <for start='0' end='60'>
                                <option value='<lt name="i" value="10">0</lt><{$i}>'><lt name="i" value="10">0</lt><{$i}></option>
                            </for>
                        </select>　分
                    </p>
                    <p><button form='msgform' class='btn btn-primary sendmsg form-control'>添　加</button></p>
                </div>
            </div>
        </div>
    </div>
</div>
<script src='__PUBLIC__'></script>
<script>
    $('.msgcontent').keyup(function(){
       if($(this).val().length > 500) {
           $(this).val($(this).val().substring(0, 500));
       }
       $('#hip').text($(this).val().length);
       $('#words').text(500 - $(this).val().length);
       $('#ts').text(Math.ceil($(this).val().length / 70));
   });
</script>